
# Length of a session ID string (used by master and node)
LEN_SESSION_ID = 16

# The port that the the master listens on for HTTP
MASTER_LISTEN_PORT = 8888

# The port that nodes listen on (used by master and node)
NODE_LISTEN_PORT = 8889

# Interval in milliseconds that javascript should ping the
# backend to keep the session alive.
JS_PING_INTERVAL = 5000

# The maximum amount of time a session is allowed to go without
# pinging before it is removed, in milliseconds.
SESSION_TIMEOUT_INTERVAL = JS_PING_INTERVAL*12

# How often the master should go through the cleanup process,
# in milliseconds.
TIMEOUT_CHECK_INTERVAL = 60000

# Maximum length of a command the user is allowed to input. Limited
# takes place in the node.
MAX_COMMAND_LEN = 500

# Maximium length in timesteps for an animation. Limiting takes place
# on the node
MAX_ANIMATION_LEN = 50

# Commands that display an expression
DISPLAY_COMMANDS = (
    'd',
    'display')

# Commands that cause the node server to regenerate and resend
# the window image
REFRESH_COMMANDS = DISPLAY_COMMANDS + (
    'cbar',
    'cbarn',
    'clear',
    'draw',
    'reinit')

# Commands that cause the node server to open new file, causing
# a refresh in certain dialogs (if open).
REFRESH_FILES_COMMANDS = (
    'close',
    'open',
    'reinit',
    'sdfopen',
    'xdfopen')

# Commands that cause the node server to send back updated dims.
REFRESH_DIMS_COMMANDS = REFRESH_FILES_COMMANDS + ('set',);

# Commands that are blocked from the user
BLOCKED_COMMANDS = (
    # General
    'quit',
    
    # printim has fwrite() access, and they have no reason to call it
    'printim',
    
    # env.gex <http://opengrads.org/doc/udxt/env/env.html>
    'env',
    'setenv',
    'printenv',
    'xenv',
    '@',) 

